import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
import index from './components/tabbar/index.vue';
import login from './components/tabbar/login.vue';
import register from './components/tabbar/register.vue';
import sortlist from './components/tabbar/sort.vue';
import categorylist from './components/categoryList/categorylist.vue';
import giftlist from './components/categoryList/giftlist.vue';
import giftcate from './components/categoryList/giftcate.vue';
import shopping from './components/shopping/shopping.vue';
import mine from './components/privated/mine.vue';
import commodityDetails from './components/commodity/commodityDetails.vue';

// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    { path: '/', redirect: '/index' },
    { path: '/index', component: index },
    { path: '/login', component: login },
    { path: '/register', component: register },
    { path: '/sort', component: sortlist },
    { path: '/categorylist', component: categorylist },
    { path: '/gifts', component: giftlist },
    { path: '/giftscate', component: giftcate },
    { path: '/shopping', component: shopping },
    { path: '/mine', component: mine },
    { path: '/commodity', component: commodityDetails },
  ],
  linkActiveClass: 'mui-active'
  
})

// 把路由对象暴露出去
export default router